﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using PlaytimeSaveTypes;

namespace BoneAnimationProt
{
    public struct Sprite
    {
        public string Name;
        public Texture2D Texture;
        public SpriteEffects Effects;
        public Vector2 Offset;
        public float rotOffset;
        public float depth;
        public Sprite(string _name, Texture2D _texture, SpriteEffects _effects, Vector2 _offset, float _rotOffset, float _depth = 1)
        {
            Name = _name;
            Texture = _texture;
            Effects = _effects;
            Offset = _offset;
            rotOffset = _rotOffset;
            depth = _depth;
        }

        public Sprite(SpriteSaveData _data)
            : this(_data.TextureName, Game1.Instance.Content.Load<Texture2D>(_data.TextureName), _data.Scale.X < 0 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, _data.Offset, _data.rotOffset, _data.depth)
        {
        }
        
    }
}
